package net.liteheaven.xfirewall.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.example.sample.activity.VpnActivity;
import com.example.sample.vpn.ForwardManager;

import net.liteheaven.xfirewall.MyApp;
import net.liteheaven.xfirewall.R;

import java.util.HashSet;

public class MainActivity extends AppCompatActivity {

    static{
        Context ctx = MyApp.getInstance();
        ForwardManager.setContext(ctx);
        ForwardManager fm = ForwardManager.getInstance();
        HashSet<String> pkgList = new HashSet<String>();
        pkgList.add("sh.lilith.dgame.mi");
        fm.setGamePkgList(pkgList);
    }

    private Button startServiceButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        startServiceButton = (Button)findViewById(R.id.startServiceButton);
        startServiceButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this, VpnActivity.class);
                startActivity(intent);
            }
        });

        ForwardManager.getInstance().isGameUid(16714);

    }
}
